<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    template="./templates/rpsTemplate.xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content">
        <p:growl id="growl" showDetail="true" globalOnly="true"/>
        <ui:include src="dialogs/password-dialog.xhtml"/>
        <ui:include src="dialogs/progress-interview-dialog.xhtml"/>
        <h:form id="frm-interview">
            <div class="content-box column-left">
                <div class="content-box-header">
                    <h3>My Current Interviews</h3>
                </div> <!-- End .content-box-header -->

                <div class="content-box-content">
                    <div class="tab-content default-tab">
                        <p>
                            <strong>#{myInterviewBean.msgNumber}</strong>
                        </p>
                        <ui:repeat value="#{myInterviewBean.myCurrentInterviews}" var="interview">
                            <div class="border">
                                <div class="event padding-b-t">
                                    <div class="title">
                                        <h3>#{calendarMB.titleFormat(interview.startedTime)}</h3>
                                        <h:link outcome="manage-interview.xhtml"
                                                title="Review"
                                                styleClass="icon-review size-32"
                                                rendered="#{interview.AVStatus!=99}"/>
                                        <h:panelGroup rendered="#{interview.AVStatus==99}">
                                            <h:panelGroup rendered="#{accountMB.interviewer}">
                                                <h:commandButton image="resources/images/icons/info.png"
                                                                 actionListener="#{myInterviewBean.progressStatus}"
                                                                 onclick="dlg_interview.show();"
                                                                 title="Information">
                                                    <f:param name="edit" value="#{interview.interviewID}" />
                                                    <f:ajax execute="@this" render=":frm-progress-interview"/>
                                                </h:commandButton>
                                                <h:link outcome="processing-interview.xhtml"
                                                        title="Change time"
                                                        styleClass="icon-clock size-32"
                                                        rendered="#{interview.status!=99}">
                                                    <f:param name="id" value="#{interview.interviewID}"/>
                                                    <f:param name="type" value="time"/>
                                                </h:link>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{accountMB.hRGroup}">
                                                <h:link outcome="processing-interview.xhtml"
                                                        title="Reschedule"
                                                        styleClass="icon-refresh size-32"
                                                        rendered="#{interview.status==-100}">
                                                    <f:param name="id" value="#{interview.interviewID}"/>
                                                    <f:param name="type" value="info"/>
                                                </h:link>
                                            </h:panelGroup>
                                        </h:panelGroup>
                                    </div>
                                    <div class="event_body">
                                        <div class="middle">
                                            <h:panelGroup rendered="#{interview.status == 0}">
                                                <div class="cal_day day_red">
                                                    <div class="day_heading">#{calendarMB.dayInWeekFormat(interview.startedTime)}</div>
                                                    <div class="day_number">#{calendarMB.dayFormat(interview.startedTime)}</div>
                                                </div>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{interview.status == 100}">
                                                <div class="cal_day day_green">
                                                    <div class="day_heading">#{calendarMB.dayInWeekFormat(interview.startedTime)}</div>
                                                    <div class="day_number">#{calendarMB.dayFormat(interview.startedTime)}</div>
                                                </div>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{interview.status == -100}">
                                                <div class="cal_day day_blue">
                                                    <div class="day_heading">#{calendarMB.dayInWeekFormat(interview.startedTime)}</div>
                                                    <div class="day_number">#{calendarMB.dayFormat(interview.startedTime)}</div>
                                                </div>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{interview.status == 99}">
                                                <div class="cal_day day_yellow">
                                                    <div class="day_heading">#{calendarMB.dayInWeekFormat(interview.startedTime)}</div>
                                                    <div class="day_number">#{calendarMB.dayFormat(interview.startedTime)}</div>
                                                </div>
                                            </h:panelGroup>
                                        </div>
                                        <div class="event_content">
                                            <p><strong>Time: </strong>
                                                #{calendarMB.timeFormat(interview.startedTime)}
                                                to #{calendarMB.timeFormat(interview.endedTime)}</p>
                                            <p><strong>Applicant name: </strong>
                                                #{interview.applicant.firstName} #{interview.applicant.lastName}</p>
                                            <p><strong>Vacancy: </strong> 
                                                #{interview.vacancy.title}</p>

                                            <p><strong>Status: </strong> #{interviewBean.statusValue(interview.status)}</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </ui:repeat>
                    </div> <!-- End #tab3 -->
                </div> <!-- End .content-box-content -->
            </div> <!-- End .content-box -->
        </h:form>

        <div class="content-box column-right">
            <div class="content-box-header"> <!-- Add the class "closed" to the Content box header to have it closed by default -->
                <h3>My Information</h3>
                <h:commandButton image="resources/images/icons/edit.png"
                                 />
            </div> <!-- End .content-box-header -->

            <div class="content-box-content">
                <div class="tab-content default-tab">
                    <h:panelGroup rendered="#{not accountMB.account.employee.gender}">
                        <div class="female"/>
                    </h:panelGroup>
                    <h:panelGroup rendered="#{accountMB.account.employee.gender}">
                        <div class="male"/>
                    </h:panelGroup>
                    <div class="personal-info">
                        <h4>#{accountMB.account.employee.firstName} #{accountMB.account.employee.lastName}
                            - #{accountMB.account.employee.employeeID}</h4>
                        <p>
                            <strong>Gender: </strong>#{employeeMB.gender(accountMB.account.employee)}
                        </p>
                        <p>
                            <strong>Date Of Birth: </strong>
                            #{calendarMB.titleFormat(accountMB.account.employee.dob)}
                        </p>
                    </div>
                    <div class="contact-info">
                        <p>
                            <strong>Phone Number: </strong>#{accountMB.account.employee.phoneNumber}
                        </p>
                        <p>
                            <strong>Email: </strong>#{accountMB.account.employee.email}
                        </p>
                        <p>
                            <strong>Address: </strong>#{accountMB.account.employee.address}
                        </p>
                    </div>
                    <div class="work-info">
                        <p>
                            <strong>Position: </strong>#{accountMB.account.employee.position}
                        </p>
                        <p>
                            <strong>Department: </strong>#{accountMB.account.employee.department.name}
                        </p>
                        <p>
                            <strong>Account: </strong>#{accountMB.account.userName}&nbsp;&nbsp;&nbsp;-
                            &nbsp;&nbsp;&nbsp;<a href="#">change password</a>
                        </p>
                    </div>
                </div> <!-- End #tab3 -->
            </div> <!-- End .content-box-content -->
        </div> <!-- End .content-box -->
    </ui:define>
</ui:composition>
